<?php
if(!defined('IN_BSTO')){ die('[ERROR] You cannot load this page directly !!!'); }

Class ServicesController Extends BaseController {

    public function index() {
        
        //$db = new DB();
        $services = array_pop($this->registry->db->get('staticManager')->getServices());               
        
        $leftContent = '';

		//echo $aboutUs->get('value');
		if ($services->get('value') == 'Default Page') {						
			$title = 'Default Page';
			$picTag = ' ';			
		} else {
			$title = 'Services';
			$picTag = '<center><img src="'.BSTO_ROOT_PATH.'views/images/about.gif" alt="" title="" class="right" /></center> ';	
		}
        
        $leftContent .= '
            <div class="title"><span class="title_icon"><img src="'.BSTO_ROOT_PATH.'views/images/bullet1.gif" alt="" title="" /></span>' . $title . '</div>
        
        		<div class="feat_prod_box_details">'. $picTag.'
            <p class="details_service">' ; 
            
        $leftContent .= $services->get('detail');
        $leftContent .= '</p> </div> ' ;
    	$user = $this->registry->db->get('userManager')->getCurrentUser();
    	$tags = array('bstoHead'=>"");
        if($user != null){
        	$tags['login'] = '<li id="login"><span> Hello, '. $user->get('username').'</span><a href="{bstoRootPath}logout">Logout</a></li>';	
        }else{
        	$tags['login'] = '<li id="login"><a href="{bstoRootPath}login">Login</a></li>';
        }
        $output = $this->registry->template->getPageContent('index', 'Services', $leftContent , $tags);
        
        echo $output;      
    }

}
?>